<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: pcl::ndt2d::NormalDist&lt; PointT &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classpcl_1_1ndt2d_1_1_normal_dist.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="#pri-types">Private 类型</a> &#124;
<a href="classpcl_1_1ndt2d_1_1_normal_dist-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">pcl::ndt2d::NormalDist&lt; PointT &gt; 模板类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>A normal distribution estimation class.  
 <a href="classpcl_1_1ndt2d_1_1_normal_dist.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="ndt__2d_8hpp_source.html">ndt_2d.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a35b40158d8a0c8884413d2219b3917ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1ndt2d_1_1_normal_dist.html#a35b40158d8a0c8884413d2219b3917ba">addIdx</a> (size_t i)</td></tr>
<tr class="memdesc:a35b40158d8a0c8884413d2219b3917ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Store a point index to use later for estimating distribution parameters.  <a href="classpcl_1_1ndt2d_1_1_normal_dist.html#a35b40158d8a0c8884413d2219b3917ba">更多...</a><br /></td></tr>
<tr class="separator:a35b40158d8a0c8884413d2219b3917ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad72ee95c77c17324d683c34915374cf1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1ndt2d_1_1_normal_dist.html#ad72ee95c77c17324d683c34915374cf1">estimateParams</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;cloud, double min_covar_eigvalue_mult=0.001)</td></tr>
<tr class="memdesc:ad72ee95c77c17324d683c34915374cf1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Estimate the normal distribution parameters given the point indices provided. Memory of point indices is cleared.  <a href="classpcl_1_1ndt2d_1_1_normal_dist.html#ad72ee95c77c17324d683c34915374cf1">更多...</a><br /></td></tr>
<tr class="separator:ad72ee95c77c17324d683c34915374cf1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebf7b0204e59622dbf5fce66edfb8f7c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structpcl_1_1ndt2d_1_1_value_and_derivatives.html">ValueAndDerivatives</a>&lt; 3, double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1ndt2d_1_1_normal_dist.html#aebf7b0204e59622dbf5fce66edfb8f7c">test</a> (const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;transformed_pt, const double &amp;cos_theta, const double &amp;sin_theta) const</td></tr>
<tr class="memdesc:aebf7b0204e59622dbf5fce66edfb8f7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the 'score' (denormalised likelihood) and derivatives of score of the point p given this distribution.  <a href="classpcl_1_1ndt2d_1_1_normal_dist.html#aebf7b0204e59622dbf5fce66edfb8f7c">更多...</a><br /></td></tr>
<tr class="separator:aebf7b0204e59622dbf5fce66edfb8f7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a8a1962b02f257dd03963e818e8035632"><td class="memItemLeft" align="right" valign="top"><a id="a8a1962b02f257dd03963e818e8035632"></a>
const size_t&#160;</td><td class="memItemRight" valign="bottom"><b>min_n_</b></td></tr>
<tr class="separator:a8a1962b02f257dd03963e818e8035632"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59e81fb2aad74748c5dc62ec1cd37ae6"><td class="memItemLeft" align="right" valign="top"><a id="a59e81fb2aad74748c5dc62ec1cd37ae6"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>n_</b></td></tr>
<tr class="separator:a59e81fb2aad74748c5dc62ec1cd37ae6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab13ee397478869548309480a51c2f2c0"><td class="memItemLeft" align="right" valign="top"><a id="ab13ee397478869548309480a51c2f2c0"></a>
std::vector&lt; size_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>pt_indices_</b></td></tr>
<tr class="separator:ab13ee397478869548309480a51c2f2c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeeb3a1374150b46cd9a046af78c8c88c"><td class="memItemLeft" align="right" valign="top"><a id="aeeb3a1374150b46cd9a046af78c8c88c"></a>
Eigen::Vector2d&#160;</td><td class="memItemRight" valign="bottom"><b>mean_</b></td></tr>
<tr class="separator:aeeb3a1374150b46cd9a046af78c8c88c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff17eedcfd896eb93939d89dd7752c46"><td class="memItemLeft" align="right" valign="top"><a id="aff17eedcfd896eb93939d89dd7752c46"></a>
Eigen::Matrix2d&#160;</td><td class="memItemRight" valign="bottom"><b>covar_inv_</b></td></tr>
<tr class="separator:aff17eedcfd896eb93939d89dd7752c46"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-types"></a>
Private 类型</h2></td></tr>
<tr class="memitem:a4201694441ed2fd28802a3bef096e4f7"><td class="memItemLeft" align="right" valign="top"><a id="a4201694441ed2fd28802a3bef096e4f7"></a>
typedef <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>PointCloud</b></td></tr>
<tr class="separator:a4201694441ed2fd28802a3bef096e4f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><h3>template&lt;typename PointT&gt;<br />
class pcl::ndt2d::NormalDist&lt; PointT &gt;</h3>

<p>A normal distribution estimation class. </p>
<p>First the indices of of the points from a point cloud that should be modelled by the distribution are added with addIdx (...).</p>
<p>Then estimateParams (...) uses the stored point indices to estimate the parameters of a normal distribution, and discards the stored indices.</p>
<p>Finally the distriubution, and its derivatives, may be evaluated at any point using test (...). </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a35b40158d8a0c8884413d2219b3917ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35b40158d8a0c8884413d2219b3917ba">&#9670;&nbsp;</a></span>addIdx()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1ndt2d_1_1_normal_dist.html">pcl::ndt2d::NormalDist</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::addIdx </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Store a point index to use later for estimating distribution parameters. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">i</td><td>Point index to store </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        {</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;          pt_indices_.push_back (i);</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ad72ee95c77c17324d683c34915374cf1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad72ee95c77c17324d683c34915374cf1">&#9670;&nbsp;</a></span>estimateParams()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1ndt2d_1_1_normal_dist.html">pcl::ndt2d::NormalDist</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::estimateParams </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>min_covar_eigvalue_mult</em> = <code>0.001</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Estimate the normal distribution parameters given the point indices provided. Memory of point indices is cleared. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cloud</td><td>Point cloud corresponding to indices passed to addIdx. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">min_covar_eigvalue_mult</td><td>Set the smallest eigenvalue to this times the largest. </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        {</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;          Eigen::Vector2d sx  = Eigen::Vector2d::Zero ();</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;          Eigen::Matrix2d sxx = Eigen::Matrix2d::Zero ();</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;          </div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;          std::vector&lt;size_t&gt;::const_iterator i;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;          <span class="keywordflow">for</span> (i = pt_indices_.begin (); i != pt_indices_.end (); i++)</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;          {</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;            Eigen::Vector2d p (cloud[*i]. x, cloud[*i]. y);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;            sx  += p;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;            sxx += p * p.transpose ();</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;          }</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;          </div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;          n_ = pt_indices_.size ();</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160; </div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;          <span class="keywordflow">if</span> (n_ &gt;= min_n_)</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;          {</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;            mean_ = sx / <span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span> (n_);</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;            <span class="comment">// Using maximum likelihood estimation as in the original paper</span></div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;            Eigen::Matrix2d covar = (sxx - 2 * (sx * mean_.transpose ())) / <span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span> (n_) + mean_ * mean_.transpose ();</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160; </div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            Eigen::SelfAdjointEigenSolver&lt;Eigen::Matrix2d&gt; solver (covar);</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;            <span class="keywordflow">if</span> (solver.eigenvalues ()[0] &lt; min_covar_eigvalue_mult * solver.eigenvalues ()[1])</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;            {</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;              PCL_DEBUG (<span class="stringliteral">&quot;[pcl::NormalDist::estimateParams] NDT normal fit: adjusting eigenvalue %f\n&quot;</span>, solver.eigenvalues ()[0]);</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;              Eigen::Matrix2d l = solver.eigenvalues ().asDiagonal ();</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;              Eigen::Matrix2d q = solver.eigenvectors ();</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;              <span class="comment">// set minimum smallest eigenvalue:</span></div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;              l (0,0) = l (1,1) * min_covar_eigvalue_mult;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;              covar = q * l * q.transpose ();</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;            }</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;            covar_inv_ = covar.inverse ();</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;          }</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160; </div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;          pt_indices_.clear ();</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<a id="aebf7b0204e59622dbf5fce66edfb8f7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aebf7b0204e59622dbf5fce66edfb8f7c">&#9670;&nbsp;</a></span>test()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structpcl_1_1ndt2d_1_1_value_and_derivatives.html">ValueAndDerivatives</a>&lt;3,double&gt; <a class="el" href="classpcl_1_1ndt2d_1_1_normal_dist.html">pcl::ndt2d::NormalDist</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::test </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>transformed_pt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>cos_theta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>sin_theta</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the 'score' (denormalised likelihood) and derivatives of score of the point p given this distribution. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">transformed_pt</td><td>Location to evaluate at. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cos_theta</td><td>sin(theta) of the current rotation angle of rigid transformation: to avoid repeated evaluation </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sin_theta</td><td>cos(theta) of the current rotation angle of rigid transformation: to avoid repeated evaluation estimateParams must have been called after at least three points were provided, or this will return zero. </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        {</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;          <span class="keywordflow">if</span> (n_ &lt; min_n_)</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;            <span class="keywordflow">return</span> ValueAndDerivatives&lt;3,double&gt;::Zero ();</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;          </div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;          ValueAndDerivatives&lt;3,double&gt; r;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;          <span class="keyword">const</span> <span class="keywordtype">double</span> x = transformed_pt.x;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;          <span class="keyword">const</span> <span class="keywordtype">double</span> y = transformed_pt.y;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;          <span class="keyword">const</span> Eigen::Vector2d p_xy (transformed_pt.x, transformed_pt.y);</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;          <span class="keyword">const</span> Eigen::Vector2d q = p_xy - mean_;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;          <span class="keyword">const</span> Eigen::RowVector2d qt_cvi (q.transpose () * covar_inv_);</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;          <span class="keyword">const</span> <span class="keywordtype">double</span> exp_qt_cvi_q = std::exp (-0.5 * <span class="keywordtype">double</span> (qt_cvi * q));</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;          r.value = -exp_qt_cvi_q;</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;          Eigen::Matrix&lt;double, 2, 3&gt; jacobian;</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;          jacobian &lt;&lt;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;            1, 0, -(x * sin_theta + y*cos_theta),</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;            0, 1,   x * cos_theta - y*sin_theta;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;          </div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;          <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; 3; i++)</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;            r.grad[i] = double (qt_cvi * jacobian.col (i)) * exp_qt_cvi_q;</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;          </div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;          <span class="comment">// second derivative only for i == j == 2:</span></div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;          <span class="keyword">const</span> Eigen::Vector2d d2q_didj (</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;              y * sin_theta - x*cos_theta,</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;            -(x * sin_theta + y*cos_theta)</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;          );</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160; </div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;          <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; 3; i++)</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;            <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0; j &lt; 3; j++)</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;              r.hessian (i,j) = -exp_qt_cvi_q * (</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;                double (-qt_cvi*jacobian.col (i)) * double (-qt_cvi*jacobian.col (j)) +</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;                (-qt_cvi * ((i==2 &amp;&amp; j==2)? d2q_didj : Eigen::Vector2d::Zero ())) +</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;                (-jacobian.col (j).transpose () * covar_inv_ * jacobian.col (i))</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;              );</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;          </div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;          <span class="keywordflow">return</span> r;</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>registration/include/pcl/registration/impl/<a class="el" href="ndt__2d_8hpp_source.html">ndt_2d.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>pcl</b></li><li class="navelem"><b>ndt2d</b></li><li class="navelem"><a class="el" href="classpcl_1_1ndt2d_1_1_normal_dist.html">NormalDist</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
